import 'package:flutter_presentation/custom_model.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_presentation/flutter_presentation.dart';
import 'package:flutter_presentation/flutter_presentation_platform_interface.dart';
import 'package:flutter_presentation/flutter_presentation_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterPresentationPlatform
    with MockPlatformInterfaceMixin
    implements FlutterPresentationPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<void> startSubScreen(CustomModel model) {
    throw UnimplementedError();
  }

  @override
  Future<void> loadData(CustomModel model) {
    // TODO: implement closeSubScreen
    throw UnimplementedError();
  }

  @override
  Future<List<Map<String, dynamic>>> getDisplays() {
    // TODO: implement getDisplays
    throw UnimplementedError();
  }

  @override
  Future<void> startSubScreenWithDisplayId(CustomModel model, int displayId) {
    // TODO: implement startSubScreenWithDisplayId
    throw UnimplementedError();
  }

}

void main() {
  final FlutterPresentationPlatform initialPlatform = FlutterPresentationPlatform.instance;

  test('$MethodChannelFlutterPresentation is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterPresentation>());
  });

  test('getPlatformVersion', () async {
    FlutterPresentation flutterPresentationPlugin = FlutterPresentation();
    MockFlutterPresentationPlatform fakePlatform = MockFlutterPresentationPlatform();
    FlutterPresentationPlatform.instance = fakePlatform;

    expect(await flutterPresentationPlugin.getPlatformVersion(), '42');
  });
}
